﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WeatherRetriever
{
    public struct FahrenheitTemp: ITemperature
    {
        private double fahrenheit;

        public FahrenheitTemp(ushort degrees)
        {
            fahrenheit = degrees;
        }

        public FahrenheitTemp(string degrees)
        {
            fahrenheit = ushort.Parse(degrees);
        }

        public override string ToString()
        {
            return (fahrenheit.ToString() + "ºF");
        }

        public double Fahrenheit
        {
            get { return fahrenheit; }
            set { fahrenheit = value; }
        }

        public double Kelvin
        {
            get { return (fahrenheit + 459.67) * ((double)5 / 9); }
            set { fahrenheit = value * ((double)9 / 5) - 459.67; }
        }

        public double Celcius
        {
            get { return (fahrenheit - 32.0) * ((double)5 / 9); }
            set { fahrenheit = value * ((double)9 / 5) + 32.0; }
        }
    }
}
